<html lang='zh-CN'>
<head>
<meta charset='utf-8'>
	<style>
		.message {
			margin: 100px;
			position: relative;
			float: left;
		}
		.message input {
			width: 150px;
			height: 50px;
		}
		
	</style>
	
</head>

<body>
	<div class='message'>
		<input>
		<button>Send</button>
	</div>
</body>
<script>
		var input = document.querySelector('.message').querySelector('input');
		var button = document.querySelector('.message').querySelector('button');
		var count = 5;
		var timer;
		button.addEventListener('click',function (){
				this.disabled = true;
				console.log(this);
				timer = setInterval(function(){
						console.log(this);
						button.innerText = '已发送了'+count+'秒';
						
						if (count<=0) {
							button.disabled = false;
							clearInterval(timer);
							button.innerText = 'Send';
							count = 5;
						}
						count--;
					},1000)
			})
	</script>
</html>